package com.cx.controller.h5.activity;

import java.util.List;

import javax.annotation.Resource;

import org.cx.base.ApiModel;
import org.cx.base.BaseController;
import org.cx.entity.Page;
import org.cx.entity.PageData;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.cx.service.activity.ActivityManager;


@RestController
@RequestMapping("h5/activity")
public class ActivityController extends BaseController{

   	@Resource
	private ActivityManager activityService;
	
   	
   	
   	/**
	 * 获取进行中活动
	 * */
    @ResponseBody
    @RequestMapping(value = "selectOngoingActPage", produces = "application/json;charset=UTF-8")
    public ApiModel selectOngoingActPage() throws Exception {
    	Page page = this.getPage();
		List<PageData> list = activityService.selectOngoingActPage(page);
		page.setPd(list);
    	return buildSuccMsg(page);
    }
   	
   	
	/**
	 * 获取活动基本信息
	 * */
    @ResponseBody
    @RequestMapping(value = "selectByPrimaryKey", produces = "application/json;charset=UTF-8")
    public ApiModel selectByPrimaryKey(Page page) throws Exception {
    	PageData pd = new PageData();
		pd = this.getPageData();
		page.setPd(pd);
		pd = activityService.selectByPrimaryKey(pd);
		pd.remove("userurl");
    	return buildSuccMsg(pd);
    }
    


}